#ifndef _FLASH_H_
#define _FLASH_H_

#include "stm32f1xx_hal.h"  // 改为HAL库头文件

// 定义Flash页地址
#define RepairServoAngleFlashAddress    ((uint32_t)0x0803D800)  // 124 存  舵机修正角度值2个字节
#define PointsNumFlashAddress           ((uint32_t)0x0803E000)  // 125  扫描点数   有效扫描点数    correct_Point_count
#define PointDataFlashAddress           ((uint32_t)0x0803E800)  // 126  点位数据，每一个点位占用3个地址  flash一个地址 4个字节
#define StartServerManageFlashAddress   ((uint32_t)0x0803F000)  // 读写起始地址第127页  STM32F103RCT6 共 256K flash,起始地址0x0800 0000 每页2K

// 函数声明
void FLASH_WriteMoreData(uint32_t startAddress, uint16_t *writeData, uint16_t countToWrite);
void FLASH_ReadMoreData(uint32_t startAddress, uint16_t *readData, uint16_t countToRead);
void write_to_flash(void);
void read_from_flash(void);
void Erase_FlashPage(uint32_t startAddress);

#endif

